﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy1_9
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            Initial();
        }
        private void Initial()
        {
            pictureBox1.Width = 120;
            pictureBox1.Height = 120;
            pictureBox1.Left = 0;
            pictureBox1.Top = this.ClientSize.Height - pictureBox1.Height;
        }
        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            pictureBox1.Left += 5;
            pictureBox1.Top -= 3;
            pictureBox1.Width -= 1;
            pictureBox1.Height -= 1;
            if (pictureBox1.Top < -pictureBox1.Height * 2)
            {
                Initial();
                timer1.Enabled = false;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            timer1.Enabled = true;
        }
    }
}
